package com.nattakute.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.nattakute.dao.RoleDAO;
import com.nattakute.model.Role;
import com.nattakute.service.RoleService;

@Service("roleService")
@Transactional
public class RoleServicesImpl implements RoleService{

	@Autowired
	private RoleDAO roleDAO;
	
	
	@Transactional
	public Boolean removeRolebyId(Integer roleId) {
		// TODO Auto-generated method stub
		return roleDAO.removeRolebyId(roleId);
	}

	
	@Transactional
	public Boolean removeRole(Role role) {
		return roleDAO.removeRole(role);
	}

	
	@Transactional
	public Boolean addRole(Role role) {
		// TODO Auto-generated method stub
		return roleDAO.addRole(role);
	}

	
	@Transactional
	public Boolean updateRole(Role role) {
		// TODO Auto-generated method stub
		return roleDAO.updateRole(role);
	}

	
	@Transactional
	public Role getRole(String userName) {
		// TODO Auto-generated method stub
		return roleDAO.getRole(userName);
	}

	
	@Transactional
	public Role getRoleById(Integer id) {
		// TODO Auto-generated method stub
		return roleDAO.getRoleById(id);
	}

	
	@Transactional
	public List<Role> getRoleNotAdmin() {
		// TODO Auto-generated method stub
		return roleDAO.getRoleNotAdmin();
	}


	public void setRoleDAO(RoleDAO roleDAO) {
		this.roleDAO = roleDAO;
	}

	
	
}
